﻿// ==================================================
// Copyright © 2016 杭州伯庸科技 版权所有
//
// 文 件 名：POIQuery
// 功能描述：
//
// 创建标识：Yu.Liang(俞 亮) 2018/3/26 11:40:01
//
// 修改标识：
// 修改描述：
// ==================================================

using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using Shine.Framework;
using SuperMap.UI;
using SuperMap.Data;
using SuperMap.Realspace;

namespace Shine.Tool
{
    public class POIQuery : BaseCommand
    {
        IApplication m_Application = null;
        public POIQuery()
        {
            base.m_caption = "POI查询";
            base.m_name = "POIQuery";
            base.m_toolTip = "POI查询";
            base.m_message = "POI查询";
            base.m_category = "tool";
        }

        public override void OnCreate(object hook)
        {
            if (m_Application == null)
            {
                m_Application = hook as IApplication;
            } 
        }

        public override void OnClick()
        {
            Camera c = (m_Application as IFramework).SceneControl.Scene.Camera;
            c.Heading = 0;
            (m_Application as IFramework).SceneControl.Scene.Camera = c;
        }

        public override int Bitmap
        {
            get
            {
                string imgFile = Application.StartupPath + "\\Images\\" + GetType().Name + ".png";

                if (System.IO.File.Exists(imgFile) == false) return 0;

                return new Bitmap(Image.FromFile(imgFile)).GetHbitmap().ToInt32();
            }
        }


        public override bool Enabled
        {
            get { //return (m_Application as IFramework).IsMapCtrlactive; 
                return false;
            }
        }
    }
}
